package com.zyf.controller;

import com.zyf.common.result.Result;
import com.zyf.service.DepartmentService;
import com.zyf.vo.hosp.DepartmentVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/** 医院排班接口
 * @author zyf
 * @date 2021年05月13日 16:54
 */
@Api(value = "医院排班接口")
@RestController
@RequestMapping("/admin/hosp/department")
public class DeptController {

    @Autowired
    private DepartmentService departmentService;

    @ApiOperation(value = "查询医院所有科室列表")
    @GetMapping("/getDeptList/{hoscode}")
    @ApiImplicitParam(name = "hoscode", value = "医院编号")
    public Result getDeptList(@PathVariable String hoscode){
        List<DepartmentVo> deptList = departmentService.findDeptTree(hoscode);
        return Result.ok(deptList);
    }
}
